package com.xxgc.zde;

import com.baomidou.mybatisplus.core.toolkit.AES;

public class TestSrfr {
    public static void main(String[] args) {
        String randomKey = AES.generateRandomKey();
        System.out.println("randomKey = " + randomKey);

// 使用随机密钥加密数据
//        String encryptedData = AES.encrypt(data, randomKey);
        String url = "jdbc:mysql://localhost:3306/zde?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC";
        String name = "root";
        String pass = "123456";

        // 使用随机密钥加密数据
        String encryptedDataUrl = AES.encrypt(url, randomKey);
        String encryptedDataName = AES.encrypt(name, randomKey);
        String encryptedDataPass = AES.encrypt(pass, randomKey);

        System.out.println("encryptedDataUrl = " + encryptedDataUrl);
        System.out.println("encryptedDataName = " + encryptedDataName);
        System.out.println("encryptedDataPass = " + encryptedDataPass);
    }
}
